Next | Prev | Up | Top | Contents | Index
Loading
A registered, loadable driver can be loaded by the lboot and ml commands. When a driver is loaded, the following steps are taken:
- The object file header is read.
- Memory is allocated for the module's text, data, and bss segments.
- The module's text and data are read.
- The module's text and data are relocated. References to kernel names and to global variables named in the master file are resolved.
- The module entry points are noted in the appropriate kernel switch table.
- The module's pfxinit() or pfxedtinit() entry point is called, depending on whether the module is specified by an INCLUDE or a VECTOR statement in the system file (see "Initialization Entry Points").
- The module's pfxstart() entry point, if any, is called.
Space allocated for the module's text, data, and bss is located in either k0seg or k2seg. Static buffers in loadable modules are not necessarily physically contiguous in memory.
When the D flag is included in the descriptive line in the descriptive file, the module is loaded at boot time and then unloaded. This gives the module a chance to update the hardware inventory.
If errors occur when a module is loaded, see the mload(4) reference page for a list of possible causes.
Next | Prev | Up | Top | Contents | Index